package com.art.utils;

import org.thymeleaf.TemplateEngine;
import org.thymeleaf.context.IContext;
import org.thymeleaf.templateresolver.ClassLoaderTemplateResolver;

import java.io.IOException;
import java.io.Writer;


/**
 * IntelliJ IDEA
 *
 * @author 谭礼赞 2038940123
 * @since 2022-11-07-2022/11/7
 */

public class ThymeleafUtil {
    private static final TemplateEngine engine;
    static{
        engine=new TemplateEngine();
        ClassLoaderTemplateResolver r=new ClassLoaderTemplateResolver ();
        engine.setTemplateResolver ( r );
    }

    public static void process(String template, IContext context, Writer writer ){
        engine.process ( template, context, writer );
    }

}
